#!/usr/bin/python
import redis

class RedisTesting:

    def __init__(self):
        pass
    
    def _test(self,host):
        try:
            redisClient=redis.StrictRedis(host=self.host,port=6379)
            if redisClient.config_get("dir"):
                return '[+] : %s redis  login  success'%self.host
            else :
                return '[-] : %s redis login failed '%self.host
        except Exception,ex:
            return  "[-] : %s redis connect time out"%self.host
    def run(self,host_port):
        self.host=host_port.keys()[0]
        
        return [self._test(self.host)]

if __name__ == '__main__':
    R=RedisTesting()
    print R.run({'192..37.129': [6379]})